﻿namespace CSharpPro._1021;

public class Demo
{
    public void TestPrint()
    {
        Father father = new Father();
        father.Print();
        Child child = new Child();
        child.Print();
        Console.WriteLine(child.id);
        
        //编译看左，执行看右
        
        // Father father2 = new Father();
        // father2.Print();
        
        Father father1 = new Father();
        
        Father father2 = new Child();
        
        Father father3 = new Son();
        father1.Print();
        father2.Print();
        father3.Print();
        Console.WriteLine("--------");
        Father father4 = new Father();
        father4.Print();
        Child child1 = new Child();
        child1.Print();
        Son son = new Son();
        son.Print();



        // int int32 = Convert.ToInt32("123");
        // Student student = new Student();
        // student.Id = 1001;
        // student.Name = "任俊澍";
        // Console.WriteLine(student.Name);
        // Student student2 = new Student(id:1002); 
        // Console.WriteLine(student2.Name); 
        // Console.WriteLine(student2.Id);
        // student2.Id = 1002;
        // student2.Name = "李四";
        // Student student3 = new Student(id:1003);
        // Console.WriteLine(student3.Name);
        // Console.WriteLine(student3.ToString());

    }

    public  int Compare(int a,int b,int c)
        //  求出最大值
    {
        if (a > b && a > c)
        {
            return a;
        }
        else if (b > c && b > a)
        {
            return b;
        }
        else if (c > b && c > a)
        {
            return c;
        }
        else
        {
            return 0;
        }
    }
}